/*********************************************************************************
*	JavaScript Library for 1499fashions.com	
**********************************************************************************/


/*********************************************************************************
*	FUNCTION	isEmpty checks if the parameter is empty or null
*	PARAMETER	str		AS String
**********************************************************************************/
function isEmpty (str) {
	if ((str==null)||(str.length==0)) return true;
	else return(false);
}

/*********************************************************************************
*	FUNCTION	isStringEmpty checks if the parameter is empty or null and focus the field
*	PARAMETER	str		AS String
**********************************************************************************/

function isStringEmpty (str,focus,errorMessage) {
	if ((str==null)||(str.length==0))
	{
		alert("Please provide "+errorMessage);
		focus.focus();
		return true;
	}
	else return(false);
}

/*********************************************************************************
*	FUNCTION	isNotNumber if the parameter is numeric or null and focus the field
*	PARAMETER	n		AS String
**********************************************************************************/

function isNotNumber (n,focus) {
	if((isNaN(n) == true) || n <= 0) 
	{
		
		return true;
	}
	else return(false);
}

/*********************************************************************************
*	FUNCTION:		checkPasswordCharacters
*	PARAMETER:		String (Password)
*	RETURNS:		FALSE if the String is a valid Password
*					TRUE if the passed string is not a valid Password
**********************************************************************************/


function checkPasswordCharacters(theStr) {
  var validchars = "abcdefghijklmnopqrstuvwxyz0123456789";
  var isOk=false;
  for (var i=0; i < theStr.length; i++) {
    var letter = theStr.charAt(i).toLowerCase();
    if (validchars.indexOf(letter) < 0) {
		isOk=true;	
		}
  }
  return isOk;
}

/*********************************************************************************
*	FUNCTION:		checkPasswordLength
*	PARAMETER:		String (Password)
*	RETURNS:		FALSE if the length < 6 OR length > 12
*					TRUE if the length between 6-12 
**********************************************************************************/


function checkPasswordLength(theStr) {
	var isOk=false;
	if(theStr.length < 6 || theStr.length > 12) {
		isOk=true;
	}
  	return isOk;
}


/*********************************************************************************
*	FUNCTION:		pagingNext
*	PARAMETER:		startrow,maxrows,pagenumber
**********************************************************************************/
function pagingNext(startrow,maxrows,pagenumber) {
	document.thisForm10.startrow.value = startrow + maxrows;
	document.thisForm10.pagenumber.value = pagenumber + 1;
	document.thisForm10.submit();
	return true;
}
/*********************************************************************************
*	FUNCTION:		pagingPrev
*	PARAMETER:		startrow,maxrows,pagenumber
**********************************************************************************/
function pagingPrev(startrow,maxrows,pagenumber) {
	document.thisForm10.startrow.value = startrow - maxrows;
	document.thisForm10.pagenumber.value =pagenumber - 1;
	document.thisForm10.submit();
	return true;
}
/*********************************************************************************
*	FUNCTION:		pagingStart
*	PARAMETER:		
**********************************************************************************/
function pagingStart() {
	document.thisForm10.startrow.value = 1;
	document.thisForm10.pagenumber.value = 1;
	document.thisForm10.submit();
	return true;
}
/*********************************************************************************
*	FUNCTION:		pagingEnd
*	PARAMETER:		startrow,totalpages
**********************************************************************************/
function pagingEnd(maxrows,totalpages) {
	document.thisForm10.startrow.value = (totalpages - 1) * maxrows + 1;
	document.thisForm10.pagenumber.value = totalpages;
	document.thisForm10.submit();
	return true;
}

/*******************
function select_innerHTML

*/
function select_innerHTML(objeto,innerHTML){
/******
* select_innerHTML - corrige o bug do InnerHTML em selects no IE
* Veja o problema em: http://support.microsoft.com/default.aspx?scid=kb;en-us;276228
* Versão: 2.1 - 04/09/2007
* Autor: Micox - Náiron José C. Guimarães - micoxjcg@yahoo.com.br
* @objeto(tipo HTMLobject): o select a ser alterado
* @innerHTML(tipo string): o novo valor do innerHTML
*******/
    objeto.innerHTML = ""
    var selTemp = document.createElement("micoxselect")
    var opt;
    selTemp.id="micoxselect1"
    document.body.appendChild(selTemp)
    selTemp = document.getElementById("micoxselect1")
    selTemp.style.display="none"
    if(innerHTML.toLowerCase().indexOf("<option")<0){//se não é option eu converto
        innerHTML = "<option>" + innerHTML + "</option>"
    }
    innerHTML = innerHTML.toLowerCase().replace(/<option/g,"<span").replace(/<\/option/g,"</span")
    selTemp.innerHTML = innerHTML
      
    
    for(var i=0;i<selTemp.childNodes.length;i++){
  var spantemp = selTemp.childNodes[i];
  
        if(spantemp.tagName){     
            opt = document.createElement("OPTION")
    
   if(document.all){ //IE
    objeto.add(opt)
   }else{
    objeto.appendChild(opt)
   }       
    
   //getting attributes
   for(var j=0; j<spantemp.attributes.length ; j++){
    var attrName = spantemp.attributes[j].nodeName;
    var attrVal = spantemp.attributes[j].nodeValue;
    if(attrVal){
     try{
      opt.setAttribute(attrName,attrVal);
      opt.setAttributeNode(spantemp.attributes[j].cloneNode(true));
     }catch(e){}
    }
   }
   //getting styles
   if(spantemp.style){
    for(var y in spantemp.style){
     try{opt.style[y] = spantemp.style[y];}catch(e){}
    }
   }
   //value and text
   opt.value = spantemp.getAttribute("value")
   opt.text = spantemp.innerHTML
   //IE
   opt.selected = spantemp.getAttribute('selected');
   opt.className = spantemp.className;
  } 
 }    
 document.body.removeChild(selTemp)
 selTemp = null
}
/*******************
function Easy Slider jQuery calls

*/
$(document).ready(function(){	
$("#slider").easySlider({	controlsFade: false, auto: true	
						});
});	
