function bookmark(){
    var title="TYKFashion Online Store"
    var url="http://www.tykfashions.com"

    if (window.sidebar) window.sidebar.addPanel(title, url,"");

    else if( window.opera && window.print )
    {
    var mbm = document.createElement('a');
    mbm.setAttribute('rel','sidebar');
    mbm.setAttribute('href',url);
    mbm.setAttribute('title',title);
    mbm.click();
    }

    else if( document.all ) window.external.AddFavorite( url, title);

}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function gotoCart(){
	document.getElementById('main_frame').src = "mycart.php";
}

function addtocart(id){
	var answer = confirm("Do you want to add this product?")
	if (answer){
		window.location = "addtocart.php?id="+id;
	}
}

function setLocation(id,loc){
	document.getElementById('action_frame').src = loc+"?linkid="+id;
}

function resizeframe(the_height)
{
	  var the_height= document.getElementById('action_frame').contentWindow.document.body.offsetWidth;
	  document.getElementById('action_frame').height=  the_height;
	 // parent.resizeindexframe();
}

function resizeindexframe()
{
	  var the_height= document.getElementById('mainframe').contentWindow.document.body.scrollHeight;
	  document.getElementById('mainframe').height=  the_height;  
}

function loadframesize()
{
	  var the_height= document.getElementById('mainframe').contentWindow.document.body.scrollHeight;
	  document.getElementById('mainframe').height=  460;
	  
}

function resizeme(){
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = window.innerWidth;
	  winH = window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = document.body.offsetWidth;
	  winH = document.body.offsetHeight;
	 }
	}
	//parent.document.getElementById('action_frame').height=  0;
	//var mframeH = parent.parent.mainframe.getsize();
	//parent.document.getElementById('action_frame').height=  document.body.scrollHeight;
	//alert(mframeH);
	//parent.parent.document.getElementById('mainframe').height=  document.body.scrollHeight;
	
	var the_height= parent.document.getElementById('action_frame').contentWindow.document.body.scrollHeight;
	parent.document.getElementById('action_frame').height=  the_height;
	var the_height= parent.parent.document.getElementById('mainframe').contentWindow.document.body.scrollHeight;
	parent.parent.document.getElementById('mainframe').height=  the_height;
	parent.parent.document.getElementById('newmenuframe').height=  the_height;
	
	
	
}

function reloadme(){

	var the_height= parent.document.getElementById('action_frame').contentWindow.document.body.scrollHeight;
	parent.document.getElementById('action_frame').height=  620;
	
	var the_height= parent.parent.document.getElementById('mainframe').contentWindow.document.body.scrollHeight;
	parent.parent.document.getElementById('mainframe').height=  620;
}

function getsize(){
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = window.innerWidth;
	  winH = window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = document.body.offsetWidth;
	  winH = document.body.offsetHeight;
	 }
	}
	return winH;
}


function submitForm(){
	document.message_form.submit();
}

function allValidChars(email) {
	  var parsed = true;
	  var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@.-_";
	  for (var i=0; i < email.length; i++) {
		var letter = email.charAt(i).toLowerCase();
		if (validchars.indexOf(letter) != -1)
		  continue;
		parsed = false;
		break;
	  }
	  return parsed;
}
	
function validateEmail(email) {
	  var parsed = false;
	  var validchars = "@";
	  for (var i=0; i < email.length; i++) {
		var letter = email.charAt(i).toLowerCase();
		if(letter==validchars){
			parsed = true;
		}
	  }
	  return parsed;
}
