// JavaScript Document\
var uNameLabel = true;
var uPassLabel = true;
	
function focusOnField(strID,strType) {
	if ((strType == "name") && (uNameLabel)) {
		var e = document.getElementById(strID)
		e.value='';
		e.className = "username-on";
		uNameLabel = false;
	}
	if ((strType == "pass") && (uPassLabel)) {
		var e = document.getElementById(strID)
		e.value='';
		e.type = "password";
		e.className = "password-on";
		uPassLabel = false;
	}		
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function launchSkype(strContact, strConfirmID) {
	if (readCookie("skype") == "YES") {
		location.href='skype:' + strContact + '?call';
	}
	else {
		document.getElementById(strConfirmID).style.display='block';
		//$j('#skype-confirm').addClass('skype-confirm-back');
		document.getElementById(strConfirmID).style.backgroundImage = "url(/kppb/images/lf/skype-back.gif?rnd=" + Math.random() + ")";		
	}
}
function closeSkype(strConfirmID) {
		document.getElementById(strConfirmID).style.display='none';
		document.getElementById(strConfirmID).style.backgroundImage = "none";	
}
function iHaveSkype(strContact,strConfirmID){
	createCookie("skype","YES",1000);
	location.href='skype:' + strContact + '?call';	
	document.getElementById(strConfirmID).style.display='none';			
}
