$(document).ready(function(){	if($('#inner_photo_caption').text().length>4){$('#inner_photo_caption').css('display', 'block')}			//$('#pencil').css('display','block');			$('.inlinead').show(function(){														 			jQuery.ajax({			url:"code/inlineshow.php",			cache: false,			success: function(response){				$('.inlinead').html(response);				//document.getElementById('ad-listing').innerHTML = response;				//$('#ad-listing').show();												}});														 									});	$('#skyline_header_xx').hoverIntent(function(){$(this).animate({'height':'+=250px'},600,'linear');},function(){$(this).animate({'height':'-=250px'},200,'linear');});						   	var photoheight = $('#inner_photo_large img').height();	if(photoheight == null)	{		$('#photo_and_caption_block').remove();	}				$('#pencil').hoverIntent(function(){$(this).animate({'height':'+=250px'},600,'linear');},function(){$(this).animate({'height':'-=250px'},200,'linear');});		//$('#pencil').mouseover(function(){$(this).animate({'height':'+=250px'},600,'linear');false;});	//$('#pencil').mouseout(function(){$(this).animate({'height':'-=250px'},200,'linear');false;});		$('#signin').click(function(){	$('#signinfields').toggle('slow');	});		$('#scroll_signin').click(function(){		$.scrollTo(0,'slow');		$('#notsignedin').toggle('slow');		$('#comment_form').toggle('slow');		$('#signinfields').toggle('slow');			});		$('#get_account_password').click(function(){	$('#forgot_password').toggle('slow');	});			$('#create_account').click(function(){	$('#account_setup_fields').toggle('slow');	});  		// show comments if add comment clicked	$('#add_comment-xxx').click(function(){	jQuery.ajax({	type:"POST",	url:"code/getuserid.php",	data:'hello=hello',	cache:false,	success:function(response){		// response will be the user_id if empty not signed in.		if(response == '')		{			$('#notsignedin').toggle('slow');		}else{			$('#comment_form').toggle('slow');		}	}			})			});		// show comments if add comment clicked	$('.show_comments').click(function(){	$.scrollTo('#add_comment-x','slow');	//$('#comment_form').toggle('slow');	});			// show comments if add comment clicked	$('#show_comment_upper').click(function(){	$.scrollTo('#add_comment-x','slow');	//$('#comment_form').toggle('slow');	});		// show comments if add comment clicked	$('#show_comment_lower').click(function(){	//$('#comment_form').toggle('slow');	});		// show comments if add comment clicked	// this may not belong......	$('#steam_comments').click(function(){	$('#comment_form').toggle('slow');	});			// these xxxclass routines can be moved to home.js	$('#autoclass').click(function(){	$('#autoclasslist').toggle('fast');	});		$('#jobclass').click(function(){	$('#jobclasslist').toggle('fast');	});		$('#merchclass').click(function(){	$('#merchclasslist').toggle('fast');	});		$('#personalclass').click(function(){	$('#personalclasslist').toggle('fast');	});		$('#realclass').click(function(){	$('#realclasslist').toggle('fast');	});		$('#serviceclass').click(function(){	$('#serviceclasslist').toggle('fast');	});		/*	// does the bounce thing on the admin form.	$('h2').animate({height: 'hide'}, 1000, 'easeOutCirc');	$('h2').animate({height: 'show'}, 2000, 'easeOutElastic');	*/	// check the user signin	$('#signin_submit').click(check_signin);		// check the user signin	$('#forgotpassword_submit').click(send_password);		// check the user signin	$('#comment_submit').click(save_comment);			$('#story_title').keyup(check_title);	$('#perma_link').keyup(check_perma_link);	// handle a click on the remove_attached_image	$('.rm_attch_img').live('click', function(){		$(this).parent().animate({height: 'hide'}, 1000, 'easeOutCirc', function(){$(this).remove()});		}); 	 $('<div id="navigation-blob"></div>').css({			width: $('#navigation li:last a').width(),			height: $('#navigation li:last a').height()+6		}).appendTo('#navigation').hide();		  $('#navigation a').hover(function(){ 		// Mouse over function		  $('#navigation-blob').animate(		  {width: $(this).width() + 10, left: $(this).position().left},			{duration: 'fast',  queue: false}		);	  }, function() { 		  // Mouse out function		  var leftPosition = $('#navigation li:first a').position().left;		  $('#navigation-blob').animate(		  {width:'hide'},				{duration:'fast',  queue:false}			).animate({left: leftPosition}, 'fast' );	  }); // this is the end of the navigation code.	// after page loads add the "Add Another Photo" button.	$('<input type="button" value="Add Another Photo" id="newPictureButton">').insertBefore('#morePhotos');	  	  // watch the Add Another Photo button, if it's clicked add a new FILE button..	$('#newPictureButton').click(function(){		var thebtnname = $('div').length;	$('<div class="field" style="display:none"><h2>Photo Upload</h2><input type="file" name=pickles value="Upload Photo" id=newphoto onChange="getfilename(this)"><a class="rm_attch_img" style="cursor:pointer; color:blue; text-decoration:underline">remove this element</a><div class="warning" id="newwarn"></div><textarea name="newcaption" cols="50" rows="4" id="caption4" autocomplete="off"></textarea></div>').insertBefore('#newPictureButton').animate({'height': 'show'}, 'slow', 'easeOutBounce');	  	  //$("#newwarn").attr('id','photo'+$('div').length);	  $("#newwarn").attr('id','photo'+thebtnname);	  $("textarea[name=newcaption]").attr('name','caption'+thebtnname);	  	  $("input[name=pickles]").attr({	  name: 'photo'+thebtnname,	  id: 'xphoto'+thebtnname	  });	   });// bookmark click codeif(window.opera) {		if ($("a.jqbookmark").attr("rel") != ""){			$("a.jqbookmark").attr("rel","sidebar");		} 	}	$("a.jqbookmark").click(function(event){		event.preventDefault();		var url = this.href;		var title = this.title;				if (window.sidebar) { // Mozilla Firefox Bookmark			window.sidebar.addPanel(title, url,"");		} else if( window.external ) { // IE Favorite			window.external.AddFavorite( url, title);		} else if(window.opera) { // Opera 7+			return false; // do nothing		} else { 			 alert('Unfortunately, this browser does not support the requested action,'			 + ' please bookmark this page manually.');		}		});// end bookmark click code}); // this is the end of the top $Jquery grouping// add a comment.  If user_relator or session['relator'] is set comment will be tagged to user.function save_comment(){var subject = $('#subject').val();var comment = $('#comment').val();var relate_comments = $('#relate_comments').val();jQuery.ajax({	type:"POST",	url:"code/save_comment.php",	data:'subject='+subject+'&comment='+comment+'&relate_comments='+relate_comments,	cache:false,	success:function(response){		$('#comment_form').toggle('slow');	}			})return false; // make the form not submit no matter what.}// look up username password, if success account_signin_check.php will set session. // will set global user_relator for this page.function check_signin(){var your_password = $('#your_password').val();var your_username = $('#your_username').val();jQuery.ajax({	type:"POST",	url:"code/account_signin_check.php",	data:'username='+your_username+'&user_pass='+your_password,	cache:false,	success:function(response){		if(response == 0){			// fail			alert('username or password incorrect');			//alert('failed');		}else{			// pass			//alert(response);			user_relator = response;			$('#signinfields').animate({ 			height: 'hide'			}, 'slow');    					}	}			})return false; // make the form not submit no matter what.}function send_password(){var your_email = $('#your_email').val();jQuery.ajax({	type:"POST",	url:"code/account_sendpassword.php",	data:'your_email='+your_email,	cache:false,	success:function(response){		if(response == 1){			// fail			alert('Email address not found.');		}else{			// pass			$('#forgot_password').animate({ 			height: 'hide'			}, 'slow');    					}	}			})return false; // make the form not submit no matter what.}function check_title(){	var story_title = $('#story_title').val();	var idkey = $('#idkey').val();	if(story_title == "" || story_title.length < 15){		$('#story_title').css('color', '#FF0000');		// alert it's to short	}else{		// do some ajax stuff		jQuery.ajax({			type: "POST",			url:"code/story_title_check.php",			data: 'story_title='+ story_title +'&idkey='+idkey,			cache: false,			success: function(response){				//alert(response);			if(response == 1){				$('#story_title').css('color', '#FF0000');				// already exists			}else{				$('#story_title').css('color', '#000000');			}			}					})	}}function check_perma_link(){	var perma_link = $('#perma_link').val();	var idkey = $('#idkey').val();	if(perma_link == "" || perma_link.length < 15){		$('#perma_link').css('color', '#FF0000');		// alert it's to short	}else{		// do some ajax stuff		jQuery.ajax({			type: "POST",			url:"code/perma_link_check.php",			data: 'perma_link='+ perma_link +'&idkey='+idkey,			cache: false,			success: function(response){			if(response == 1){				$('#perma_link').css('color', '#FF0000');				// already exists			}else{				$('#perma_link').css('color', '#000000');			}			}					})	}}function getfilename(thepassvalue){var fName = thepassvalue.value; // get the name of the file passed. var the_ele_id = thepassvalue.id // get the element idvar the_ele_name = thepassvalue.name;  //get the name of the input file.var mybutton = '#'+the_ele_name;fullName = fName;shortName = fullName.match(/[^\/\\]+$/);jQuery.ajax({   type: "POST",   url: "check.php",   data: 'shortname='+ shortName,   cache: false,   success: function(response){   	if(response == 1){	// this will set the "the_ele_name" to the innerHTML text.	the_msg = "WARNING: Image with that name already exists on Server.";		document.getElementById(the_ele_name).innerHTML = the_msg;	$('<img/>').attr({	src: 'photo_small/'+shortName,	alt: the_ele_id,	id: the_ele_id+'y'	})	.insertAfter('#'+the_ele_id);	$('img').before('<br>');		}else{	document.getElementById(the_ele_name).innerHTML = 'File OK to Upload to Server.'	}	}})}function openCategory(category, index){	var type = new Array();  type[0] = "#";  type[1] = "Journal";  type[2] = "Source";  type[3] = "Sun";  type[4] = "Gowanda";  for(i=1; i<5; i++)  {	if(i!=index) {		document.getElementById(type[i]).style.display = "none";	}	else {		if(index!=0)		{			document.getElementById(type[i]).style.display = "inline";		}	}  }}function setCategory(category){document.inputform.the_section.value = category}function open_window(theURL,winName,features) { //v1.0  window.open(theURL,winName,features);}
