// Refresh
function reFresh() {
location.reload(true)
}
window.setInterval("reFresh()",300000);


// Initiate iScroll
function loaded() {
myScroll = new iScroll('content');
}
document.addEventListener('DOMContentLoaded', loaded);


////////// Featured
//body { padding: 0px; width: auto; height: auto;}
//#gallery { position: relative; width:560px; height:354px; margin:0; padding:0; }
//#gallery li { display: block; }
//
//
//function OpenWin(section) {
//mainX = (screen.availWidth);
//mainY = (screen.availHeight);
//newWin = window.open(section, 'see_window', 'left=0, top=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width='+mainX+', height='+mainY);
//}


///////// Disable the automatic changing of the background colors of text input fields
//if(window.attachEvent)
//window.attachEvent("onload",setListeners);
//
//function setListeners(){
//inputList = document.getElementsByTagName("INPUT");
//for(i=0;i<inputList.length;i++){
//inputList[i].attachEvent("onpropertychange",restoreStyles);
//inputList[i].style.backgroundColor = "";
//}
//selectList = document.getElementsByTagName("SELECT");
//for(i=0;i<selectList.length;i++){
//selectList[i].attachEvent("onpropertychange",restoreStyles);
//selectList[i].style.backgroundColor = "";
//}
//}
//
//function restoreStyles(){
//if(event.srcElement.style.backgroundColor != "")
//event.srcElement.style.backgroundColor = "";


////////// Hint Magazine subscription
//characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU0123456789";
//		
//function randString() {
//input = "";
//for (count = 0; count < 10; count++) {
///////// gen number between 0 and 61
//index = Math.floor (Math.random () * 62)
//input += characters.charAt (index);
//}
//return input;
//}
//		
//function fillField() {
//document.regform.screenname.value = randString();
//document.regform.password.value = document.regform.confirm.value = randString();
//}


// Check for correctly filled in info
function checkData (){

if (document.fashion.email.value.length ==0){
alert("Please enter an email address.")
return false}
if (document.fashion.email.value.length >0){
i=document.fashion.email.value.indexOf("@")
j=document.fashion.email.value.indexOf(".",i)
k=document.fashion.email.value.indexOf(",")
kk=document.fashion.email.value.indexOf(" ")
jj=document.fashion.email.value.lastIndexOf(".")+1
len=document.fashion.email.value.length

if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) &&
(len-jj >=2) && (len-jj<=3)) {
}
else {
alert("Please enter an exact email address.\n" +
document.fashion.email.value + " is invalid.")
return false }
}
}

// Tooltip

/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */

this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};



// starting the script on page load
$(document).ready(function(){
	tooltip();
});

