// JavaScript Document

var sl_head='style="color:#990000;font-weight:bold;font-size:16px;font-family: Arial, Helvetica, sans-serif;"';
var sl_body='style="color: #990000; font-weight: normal; font-size: 16px;font-family: Arial, Helvetica, sans-serif;"';
var sl_qw = 'quote' + 'wharf'+ '.c' + 'om';
var sl_addlines = '%0A%0A%0A%0A%0A%0A%0A%0A%0A';
var sl_clickemail = '<span ' + sl_body + '>(click left button to email)</span>';

function pause(numberMillis) {
  var now = new Date();
  var exitTime = now.getTime() + numberMillis;
  while (true) {
    now = new Date();
     if (now.getTime() > exitTime) return;
  }
}

function skypebutton(name,method){
  return '<a title="" href="skype:'+ name +'?'+ method +'" onMouseOver="skypeonMouseOver(this); return true;" onmouseout="window.status=\'\'; return true;"><img src="http://mystatus.skype.com/smallclassic/'+ name +'" border="0"></a>';
}  

function clickemail(email,cc){

  window.location.href = 'mai' + 'lt' + 'o:' + email.replace(/~NoSpam~/g,"@") + js_subject + sl_addlines + window.location + '&cc='+ cc.replace(/~NoSpam~/g,"@")  ;

}



function emailbutton(email,cc){

  iat = email.indexOf('@');

  return '<a href="javascript:void(0)" onMouseOver="emailonMouseOver(this); return true;" onmouseout="window.status=\'\'; return true;" onclick="clickemail(\'' + email.replace(/@/g,"~NoSpam~") + '\',\'' + cc.replace(/@/g,"~NoSpam~") + '\');"><img src=\'email_image.php?e=' + email.substring(0,iat) + '&c=0000ff&fs=10&d=' + email.substring(iat+1,email.length) + '&bc=ffffff\' border=0></a>' ;

}



function emailonMouseOver(anc){

  anc.title = 'Click here to email me , thank you !' ;

  window.status= 'Click here to email me !' ;

}



function skypeonMouseOver(anc){

  anc.title = 'Click here to chat wiht me via Skype.\nEmail to me if no one answer, thank you very much.' ;

  window.status= 'Click here to chat wiht me via Skype. Email to me if no one answer, thank you very much.' ;

}



function telno(no){

  today = new Date();

  hours = today.getHours();

  if ((today.getDay()==0) || (today.getDay()==6) || (hours >= 18) || (hours < 8) ) {

    return '<font color="#BBBBBB" onMouseOver="telonMouseOver(this); return true;" onmouseout="window.status=\'\'; return true;" >' + no + '</font>' ;

  } else {

    return '<font onMouseOver="telonMouseOver(this); return true;" onmouseout="window.status=\'\'; return true;" >' + no + '</font>' ;

  }

}



function telonMouseOver(anc){

  today = new Date();

  hours = today.getHours();

  hint = 'If nobody answer , please email to me , thank you .' ;

  hint2 = 'If nobody answer , please email to me , thank you .' ;

  if ((today.getDay()==0) || (today.getDay()==6) || (hours >= 18) || (hours < 8) ) {

	anc.title = hint ;

	window.status = hint ;

  } else {

	anc.title = hint2 ;

	window.status = hint2 ;

  }

}



function SiliconeBraceletSales()

{
document.write('<div id="divContactInfo">');
document.write('<table align="center" width="80%" border="1" cellspacing="1" cellpadding="1"><tr '+sl_head+'><td nowrap>Location</td><td nowrap>Contacts</td><td nowrap >Email</td><td nowrap >Instant Messengers</td><td nowrap >Phone Number</td></tr>') ;
document.write('<tr><td '+ sl_head+'">Yiwu, China</td><td '+ sl_head+'">Sale Rep.</td><td '+ sl_head +'>' + emailbutton('inqui' + 'ry@'+ sl_qw ,'') +'</td><td '+ sl_body +'>'+ skypebutton('cableeric','chat') +'</td><td nowrap>'+ telno('+86-579-85050202')+'&nbsp;</td></tr>') ;
document.write('</table>');
document.write('</div>');
}



var xmlHttp = false;

function  createRequest() {

	if(window.ActiveXObject) {

		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");

	} else if(window.XMLHttpRequest) {

		xmlHttp = new XMLHttpRequest();

	}

	if (!xmlHttp) {

		//alert('can not creat ajax');

		return false;

	}

}



function recordaction(act,para){

	createRequest();

	var url = "ajax_action" + "s.php?act=" + act + '&para=' + escape(para);

	xmlHttp.open("GET", url, true);

	xmlHttp.onreadystatechange =

	function(){

		if(xmlHttp.readyState!=4){return; }

		if(xmlHttp.status==200){

			//document.getElementById('debug').innerHTML = xmlHttp.responseText;

		}

	};

	xmlHttp.send(null);	

}



function loadcontactinfo(id,dContact) {

	createRequest();

	var url = "../forwarder/ajax_contactinfo.php?id=" + id + "&lang=en";

	xmlHttp.open("GET", url, true);

	xmlHttp.onreadystatechange =

	function(){

		if(xmlHttp.readyState!=4){return; }

		if(xmlHttp.status==200){

			document.getElementById(dContact).innerHTML = xmlHttp.responseText;

		}

	};

	xmlHttp.send(null);

}



function frmPaypal(fname,fclick){

if(fclick==null)fclick = 'checkout();';

document.write('<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="' + fname+ '" target="_blank">');

document.write('<input type="hidden" name="cmd" id="cmd" value="_xclick">');

document.write('<input type="hidden" name="business" id="business" value="'+ 'ginifab'+'@'+'urs'+'upplie'+'r'+'.'+'com'+'">');

document.write('<input type="hidden" name="item_name" id="item_name" value="">');

document.write('<input type="hidden" name="item_number" id="item_number" value="">');

document.write('<input type="hidden" name="amount" id="amount" value="0">');

document.write('<input type="hidden" name="button_subtype" id="button_subtype" value="products">');

document.write('<input type="hidden" name="cn" id="cn" value="Add special instructions to the seller">');

document.write('<input type="hidden" name="no_shipping" id="no_shipping" value="2">');

document.write('<input type="hidden" name="rm" value="1">');

document.write('<input type="hidden" name="return" id="return" value="">');

document.write('<input type="hidden" name="cancel_return" id="cancel_return" value="">');

document.write('<input type="hidden" name="currency_code" value="USD">');

document.write('<input type="hidden" name="on0" id="on0" value="Eric Lin">');

document.write('<input type="hidden" name="os0" id="os0" value="Eric Lin">');

document.write('<input type="hidden" name="on1" id="on1" value="">');

document.write('<input type="hidden" name="os1" id="os1" >');

document.write('<input type="hidden" name="quantity" id="quantity" >');

document.write('<input type="hidden" name="shipping" value="0">');

document.write('<input type="hidden" name="shipping2" value="0">');

document.write('<input type="hidden" name="handling" value="0">');

document.write('<input name="submit" type="image" style="cursor:hand;" onClick="'+ fclick +'" src="img/btn_buynowCC_LG.gif" alt="PayPal - The safer, easier way to pay online!" align="middle" width="122" height="47" border="0">');

document.write('</form>');

}



function smallcolortable(fclick,pickElement){

var aColor = new Array(["f9b2b7","Pink PMS 1767"],["ea0f6b","Hot Pink PMS 213"], ["72166b","Purple PMS 259"],

["75b2dd","Light Blue PMS 292"],["00a3dd","Blue PMS 299"],["0072C6","Royal BLue PMS 300"],

["00337f","Dark Blue PMS 288"],["ce1126","Red PMS 186"],["8c2633","Maroon PMS 202"],

["00b760","Green PMS 354"],["00493f","Forrest Green PMS 3302"],["008789","Teal PMS 321"],

["f9e24c","Yellow PMS 114"],["ffc61e","Athletic Gold PMS 123"],["ffd600","Lemon Yellow PMS 012C"],

["ef6b00","Orange PMS 021"],["ffffff","White"],["000000","Black"]);



document.write('<table height="1" border="0" cellpadding="1" cellspacing="1" style="font-size:9px;background-color:#CCCCCC;"><tr>');

for(var i=0;i<aColor.length;i++){

document.write('<td bgcolor="#' + aColor[i][0] + '" onClick="' + fclick + '(\'' + aColor[i][0] + '\',\'' + aColor[i][1] +'\');" title="' + aColor[i][1] + '">' + 

'<a href="javascript:void(0);" style="text-decoration:none;">&nbsp;&nbsp;&nbsp;</a></td>');

}

document.write('<td bgcolor="#ffffff" nowrap><div id="' + pickElement + '"><a href="javascript:void(0);" style="text-decoration:none;">&nbsp;more color&nbsp;</a></div></td>');

document.write('</tr></table>');

}

