// JavaScript Document

<!--

	var tdWrapperMouseOut = false;

	var tdMainTitleCategoriesWrapperMouseOut = false;

	$jquery(document).ready(function(){

		

		var oWrapperPos = Element.cumulativeOffset($("tdWrapper"));

		var oWrapperPos2 = Element.cumulativeOffset($("tdMainTitleCategoriesWrapper"));

		var oWidth = Element.getWidth($("tdWrapper"));

		var oWidth2 = Element.getWidth($("tdMainTitleCategoriesWrapper"));

		var oHeight = Element.getHeight($("tdWrapper"));

		var oHeight2 = Element.getHeight($("tdMainTitleCategoriesWrapper"));

		var startX = oWrapperPos.left;

		var startX2 = oWrapperPos2.left;

		var endX = startX+oWidth;

		var endX2 = startX2+oWidth2;

		var startY = oWrapperPos.top;

		var startY2 = oWrapperPos2.top;

		var endY = startY+oHeight;

		var endY2 = startY2+oHeight2;

		var observed = $("tdWrapper");

		var timeoutWrapper=null;

		//mouseover event observer for td mainTitleCategoriesWrapper(id) which holds divCategories,tdMainTitle and span.Archive,Contact,Slide for changing opacity

		Event.observe($("tdMainTitleCategoriesWrapper"),"mouseover",function(){

			//if(timeoutWrapper!=null)clearTimeout(timeoutWrapper);

			if(tdMainTitleCategoriesWrapperMouseOut){

				if(globalFsSelected!=null){

					if(globalFsSelected=="contact"){

						$$("ul.ulCategories li,ul.ulArchive li,span.spanArchive, span.spanSlide, span.spanCreator").each(

								function(node){

									if(node.getAttribute("fsSelected")!=null && node.getAttribute("fsSelected")=="false"){

										$jquery("#"+node.getAttribute("id")).animate({opacity:1.0},200,function(){

											$(node).setOpacity(1.0);

										});

									}

								}

						);

						$jquery("#tdMainTitle").animate({opacity:1.0},200,function(){$("tdMainTitle").setOpacity(1.0);});

					}

				}

				

			}

			tdMainTitleCategoriesWrapperMouseOut=false;

		});

		

		

		Event.observe($("tdMainTitleCategoriesWrapper"),"mouseout",function(e){

			//var hide=function(){

				if(globalFsSelected!=null){

					var x = Event.pointerX(e);

					var y = Event.pointerY(e);

					if(globalFsSelected=="contact"){

						if(x>=startX2 && x<=endX2 && y>=startY2 && y<=endY2){

							tdMainTitleCategoriesWrapperMouseOut = false;

						}else{

							tdMainTitleCategoriesWrapperMouseOut = true;

							//$jquery("#tdWrapper").animate({opacity:0.1},400,function(){});

							$$("ul.ulCategories li,ul.ulArchive li,span.spanArchive,span.spanSlide,span.spanCreator").each(

								function(node){

									if(node.getAttribute("fsSelected")!=null && node.getAttribute("fsSelected")=="false"){

										$jquery("#"+node.getAttribute("id")).animate({opacity:0.1},200);

									}

								}

							);

							$jquery("#tdMainTitle").animate({opacity:0.3},200);

						}

					}

				}

			

			//};//hide function

			//timeoutWrapper=setTimeout(hide,0);

		});

		

		

		

		Event.observe($("tdWrapper"),"mouseover",function(){

			//if(timeoutWrapper!=null)clearTimeout(timeoutWrapper);

			if(tdWrapperMouseOut){

				if(globalFsSelected!=null){

					if(globalFsSelected=="category"){

						//$jquery("#tdWrapper").animate({opacity:1.0},400,function(){$("tdWrapper").setOpacity(1.0);});

						//$jquery("#tdMainTitle").animate({opacity:1.0},400,function(){});

						$$("ul.ulCategories li,ul.ulArchive li,span.spanArchive,span.spanContact, span.spanSlide,span.spanCreator").each(

								function(node){

									if(node.getAttribute("fsSelected")!=null && node.getAttribute("fsSelected")=="false"){

										$jquery("#"+node.getAttribute("id")).animate({opacity:1.0},200,function(){

											$(node).setOpacity(1.0);

										});

									}

								}

						);

						$jquery("#tdMainTitle").animate({opacity:1.0},200,function(){$("tdMainTitle").setOpacity(1.0);});

					}else if(globalFsSelected=="contact"){

						return;

						$$("ul.ulCategories li,ul.ulArchive li,span.spanArchive, span.spanSlide,span.spanCreator").each(

								function(node){

									if(node.getAttribute("fsSelected")!=null && node.getAttribute("fsSelected")=="false"){

										$jquery("#"+node.getAttribute("id")).animate({opacity:1.0},200,function(){

											$(node).setOpacity(1.0);

										});

									}

								}

						);

						$jquery("#tdMainTitle").animate({opacity:1.0},200,function(){$("tdMainTitle").setOpacity(1.0);});

					}else if(globalFsSelected=="archive"){

						$$("ul.ulCategories li,ul.ulArchive li,span.spanContact,span.spanSlide,span.spanCreator").each(

								function(node){

									if(node.getAttribute("fsSelected")!=null && node.getAttribute("fsSelected")=="false"){

										$jquery("#"+node.getAttribute("id")).animate({opacity:1.0},200,function(){

											$(node).setOpacity(1.0);

										});

									}

								}

						);

						$jquery("#spanArchive").animate({opacity:1.0},200,function(){$("spanArchive").setOpacity(1.0);});

						$jquery("#tdMainTitle").animate({opacity:1.0},200,function(){$("tdMainTitle").setOpacity(1.0);});

					}

				}

				

			}

			tdWrapperMouseOut=false;

		});

		

		Event.observe($("tdWrapper"),"mouseout",function(e){

			//var hide=function(){

				if(globalFsSelected!=null){

					var x = Event.pointerX(e);

					var y = Event.pointerY(e);

					if(globalFsSelected=="category"){

						

						if(x>=startX && x<=endX && y>=startY && y<=endY){

							tdWrapperMouseOut = false;

							return;

						}else{

							tdWrapperMouseOut = true;

							//$jquery("#tdWrapper").animate({opacity:0.1},400,function(){});

							$$("ul.ulCategories li,ul.ulArchive li,span.spanArchive,span.spanContact,span.spanSlide,span.spanCreator").each(

								function(node){

									if(node.getAttribute("fsSelected")!=null && node.getAttribute("fsSelected")=="false"){

										$jquery("#"+node.getAttribute("id")).animate({opacity:0.1},200);

									}

								}

							);

							$jquery("#tdMainTitle").animate({opacity:0.3},200);

						}

						//}

						//$jquery("#tdMainTitle").animate({opacity:0.1},400,function(){});

					}else if(globalFsSelected=="contact"){

						if(x>=startX && x<=endX && y>=startY && y<=endY){

							tdWrapperMouseOut = false;

							return;

						}else{

							tdWrapperMouseOut = true;

							return;

							//$jquery("#tdWrapper").animate({opacity:0.1},400,function(){});

							$$("ul.ulCategories li,ul.ulArchive li,span.spanArchive,span.spanSlide,span.spanCreator").each(

								function(node){

									if(node.getAttribute("fsSelected")!=null && node.getAttribute("fsSelected")=="false"){

										$jquery("#"+node.getAttribute("id")).animate({opacity:0.1},200);

									}

								}

							);

							$jquery("#tdMainTitle").animate({opacity:0.3},200);

						}

					}else if(globalFsSelected=="archive"){

						if(x>=startX && x<=endX && y>=startY && y<=endY){

							tdWrapperMouseOut = false;

							return;

						}else{

							tdWrapperMouseOut = true;

							//$jquery("#tdWrapper").animate({opacity:0.1},400,function(){});

							$$("ul.ulCategories li,ul.ulArchive li,span.spanContact,span.spanSlide,span.spanCreator").each(

								function(node){

									if(node.getAttribute("fsSelected")!=null && node.getAttribute("fsSelected")=="false"){

										$jquery("#"+node.getAttribute("id")).animate({opacity:0.1},200);

									}

								}

							);

							$jquery("#spanArchive").animate({opacity:0.3},200);

							$jquery("#tdMainTitle").animate({opacity:0.3},200);

						}

					}

				}

			

			//};//hide function

			//timeoutWrapper=setTimeout(hide,0);

		});

		

		//show Main Content when loaded document to fade in Main Photo, Title of photographer, Categories and etc

		var showMain=function(){

			$jquery("#topPhoto").animate({opacity:1},1000,function(){

				$jquery("#tdMainTitle").animate({opacity:1},1500,function(){

					if($jquery.browser.msie){

						$("tdMainTitle").style.cssText="";

					}

					$jquery("#divCategories").animate({opacity:1},900,function(){

						if($jquery.browser.msie){

							$("divCategories").style.cssText="";

						}	

					});

					$jquery("#tdSubCategory").animate({opacity:1},900,function(){

						if($jquery.browser.msie){

							$("tdSubCategory").style.cssText="";

						}	

					});
					
					$jquery("#tdCreator").animate({opacity:1},900,function(){
						if($jquery.browser.msie){
							$("tdCreator").style.cssText="";
						}
					});
					
				});	

			});

		};

		setTimeout(showMain,500);

		

		$$("ul.ulCategories li,ul.ulArchive li,span.spanArchive,span.spanContact, span.spanSlide").each(

									function(node){

										node.onmouseover=function(e){

											this.style.color='#000000';

											

										};

										node.onmouseout=function(e){

											if(node.getAttribute("fsSelected")!=null && node.getAttribute("fsSelected")=="false"){

												this.style.color='rgb(120,120,120)';

											}

											

										};

								    }

								   );

		

		

	});

//-->