//function()
var apic = {
	
	/*
	dark_screen start
	*/
	domain:document.domain,
	url:'http://'+document.domain+'/',
	darkScreenOnOff:null,
	
	/*
	 * private function 
	 */
	createDarkScreen:function(){
		var d = this.newElement("DIV");
	
		d.className = 'darkcan';
		$(d).css('width',$(document).width()).css('height',$(document).height()).css('position','absolute')
		.css('left',0).css('top',0).css('backgroundColor','#000000').css('opacity','0.5').css('zIndex','100');
		
		document.body.appendChild(d);
		this.darkScreenOnOff = true;
	},
	
	setDarkScreen:function(){
		if(!this.darkScreenOnOff)
			this.createDarkScreen();
		else
			this.showDarkScreen();
	},
	
	showDarkScreen:function(){
		$('div.darkcan').css('display','');
	},
	
	/*
   * private function 
   */
	closeDarkScreen:function(){
		$('div.darkcan').css('display','none');
	},
	
	hiddenDarkScreen:function(){
		this.closeDarkScreen();
	},
	
	delDarkScreen:function(){
		$('div.darkcan').remove();
		this.darkScreenOnOff = false;
	},
	
	issetDarkScreen:function(){
		if(this.darkScreenOnOff)
			return true;
		return false;
	},
	
	/*
	dark_screen end
	*/
	/*
	windows functions
	*/
	createWindowContent:function(){
		
		if(!this.isdefined($('.wincontent').get(0))){
			$(document.body).append('<div class="wincontent"></div>');
			$('.wincontent').css("position","absolute").css("display","none").css('zIndex','110');;
		}
		
	},
	
	addToWindowContent:function(html){
		if(this.isdefined($('.wincontent').get(0)))
			$('.wincontent').html(html);
	},
	
	openWindow:function(data){
		if(this.isdefined($('.wincontent').get(0))){
			
			//var width = data.width;
			//var height = data.height;
			var width = $('.wincontent').outerWidth();
			var height = $('.wincontent').outerHeight();
			
			var left = 0;
			var top = 0;
			var position = data.position;
			var scrollY = 0;
			
			if(this.isdefined(window.scrollY))
				scrollY = window.scrollY;
			else
				scrollY = $(window).scrollTop();
			
			switch(position){
				case "center":
					left = ( $(window).width()/2 ) - width/2;
					top = ( ( $(window).height()/2 ) - height/2 ) + scrollY;
					break;
			}
			
			$('.wincontent').css("left",left).css("top",top).css("display","");
			
		}
	},
	
	closeWindow:function(){
		if(this.isdefined($('.wincontent').get(0)))
			$('.wincontent').css("display","none");
	},
	/*
	windows functions end
	*/
	
	addChild:function(e){
		
	},
	
	newElement:function(e){
		return document.createElement(e);
	},
	
	delElement:function(e){
		this.getParent(e).removeChild(e);
	},
	
	/*boolean function*/
	isdefined:function(o){
		if(typeof o == 'undefined')
			return false;
		return true;
	},
	
	isNull:function(o){
	  if(o == null)
	   return true;
	  return false;
	},
	
	isTag:function(o, t){
		if(this.toupper(o.tagName) == this.toupper(t)){
			return true;
		}
		return false;
	},
	
	isTextNode:function(t){
		if(t.nodeName == "#text")
			return true;
		return false;
	},
	/*boolean function*/
	
	/*string function*/
	toupper:function(str){
    	return (str + '').toUpperCase();
	},
	
	tolower:function(str){
		return (str + '').toLowerCase();
	},
	
	strpos:function(haystack, needle, offset) {
	    // http://kevin.vanzonneveld.net
	    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	    // +   improved by: Onno Marsman    
	    // +   bugfixed by: Daniel Esteban
	    // +   improved by: Brett Zamir (http://brett-zamir.me)
	    // *     example 1: strpos('Kevin van Zonneveld', 'e', 5);
	    // *     returns 1: 14
	
	    var i = (haystack+'').indexOf(needle, (offset || 0));
	    return i === -1 ? false : i;
	},
	
	strrpos:function(haystack, needle, offset) {
	    // http://kevin.vanzonneveld.net
	    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	    // +   bugfixed by: Onno Marsman
	    // +   input by: saulius
	    // +   bugfixed by: Brett Zamir (http://brett-zamir.me)
	    // *     example 1: strrpos('Kevin van Zonneveld', 'e');
	    // *     returns 1: 16
	    // *     example 2: strrpos('somepage.com', '.', false);
	    // *     returns 2: 8
	    // *     example 3: strrpos('baa', 'a', 3);
	    // *     returns 3: false
	    // *     example 4: strrpos('baa', 'a', 2);
	    // *     returns 4: 2
	
	    var i = -1;
	    if (offset) {
	        i = (haystack+'').slice(offset).lastIndexOf(needle); // strrpos' offset indicates starting point of range till end,
	        // while lastIndexOf's optional 2nd argument indicates ending point of range from the beginning
	        if (i !== -1) {
	            i += offset;
	        }
	    }
	    else {
	        i = (haystack+'').lastIndexOf(needle);
	    }
	    return i >= 0 ? i : false;
	},
	trim2:function(str) {
		var whitespace = ' \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000';
		for (var i = 0; i < str.length; i++) {
			if (whitespace.indexOf(str.charAt(i)) === -1) {
				str = str.substring(i);
				break;
			}
		}
		for (i = str.length - 1; i >= 0; i--) {
			if (whitespace.indexOf(str.charAt(i)) === -1) {
				str = str.substring(0, i + 1);
				break;
			}
		}
		return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
	},
	trim:function(str) {
		str = str.replace(/^\s+/, '');
		for (var i = str.length - 1; i >= 0; i--) {
			if (/\S/.test(str.charAt(i))) {
				str = str.substring(0, i + 1);
				break;
			}
		}
		return str;
	},

	
	/*string function*/
	
	/*
	dodac drugi parametr okreslajacy ktory element jako nastepny wyszukac narazie 
	drugi parametr nieistnieje a okreslany jest jako pierwszy kolejny po 
	okreslonym objekcie
	*/
	nextObj:function(t){
		var o = t.nextSibling;
		if(this.isNull(o))
		  return null;
		if(this.isTextNode(o))
			return this.nextObj(o);
		return o;
	},
	prevObj:function(t){
		var o = t.previousSibling;
		if(this.isNull(o))
		  return null;
		if(this.isTextNode(o))
			return this.prevObj(o);
		return o;
	},
	
	getParent:function(t){
    	return t.parentNode;
	},
	
	findParent:function(t,tagName){
    var par = t.parentNode;
    if(typeof par == 'undefined' || par == null) return false;
    if( !this.isTag(par,tagName) )
      return this.findParent(par, tagName);
    else
      return par;
  },
	firstChild:function(t){
    var c = t.firstChild;

    while( this.isTextNode(c) ){
      c = this.nextObj(c);
      if(this.isNull(c))
        return undefined;
    }
    
    return c;
	},
	/*
   * t = object
   * n = number position child
  */
	getChild:function(t, n){
	  if(!this.isdefined(t.children)){
	    
	    var ar = {};
	    var wsk = 0;
	    var c = this.firstChild(t);
      ar[wsk++] = c;  
      while( true ){
        c = this.nextObj(c);
        if(this.isNull(c))
          break;
        ar[wsk++] = c;
      }
      ar['length'] = wsk;
      t.children = ar;
	  }
	  
	  if(this.isdefined(n)){
	    
	    switch(n){
	      case 'first':
	         n = 0;
	       break;
	      case 'last':
	         n = this.getChild(t).length-1;
	       break;
	    }
	    if(n == 'all')
        return t.children;
	    else
        return t.children[n];
    }
    else
      return t.children;
	},
	
	getChild_old:function(t, n, tag){
	  /*
     * old version
     * if function on up dont work 
     * must runing om down functions
     */

    var tag_bit = false;
    if(this.isdefined(tag))
      tag_bit = true;
      
    if(!this.isdefined(n))
      n = 1;
    if(n == 0)
      return undefined;
    
    if(n == 'first' || n == 1){
      if(!this.isdefined(t.children) || tag_bit){
        var c = t.firstChild;
        
        while( this.isTextNode(c) || ( !this.isTag(c,tag) && tag_bit ) ){
          c = this.nextObj(c);
          if(this.isNull(c))
            return undefined;
        }
        
        return c;
      }else{
        return t.children[0];
      }
    }
    
    if(n > 0){
      return t.children[n-1];
    }
    
    if(n == 'last'){
      return t.children[t.children.length-1];
    }
    
    return undefined;
	},
	/*
   * t = object
   * n = number position child
   * tag = tagName searching object
  */
	findChild:function(t, n, tag){
	  
    var pos = 0;
	  var wsk = 0;
	  var lista = this.getElements(t, tag);
	  switch(n){
      case 'first':
        n = 0;
      break;
      case 'last':
        n = lista.length-1;
      break;
    }
	  return lista[n];
	},
	/*
	 * private function
	 * 
	*/
	getElements:function(t, tag){
	  var ar = {};
    var pos = 0;
    var wsk = 0;
    var tag_bit = false;
    if(this.isdefined(tag))
      tag_bit = true;
      
    if(!tag_bit){
      return this.getChild(t,'all');
    }
      
    while(true){
      var c = this.getChild(t,pos++)
      if(this.isNull(c))
        break;
      if(this.isTag(c,tag))
        ar[wsk++] = c;
    }
    ar.length = wsk;
    return ar;
	},
	goToBlock:false,
	goTo:function(url, target)
	{
	  if(this.goToBlock){
	    this.goToBlock = false;
	    return false;
	  }
			var a = document.createElement('A');
			if(!a.click) //for IE
			{
				window.location = url; //location nie wysyla referera dla IE
				return true;
			}
			
			a.setAttribute("href", url);
			a.style.display = "none";
			if(typeof target != 'undefined')
				a.target = target;
			document.body.appendChild(a);
			a.click();
			/*FF5 bug */
			setTimeout(function(){
			  window.location = url;
			},100);
			return true;
	}

};//() //end apic

/*HINT*/
var hinttimeout=0;
var hintatimeout=0;
/*
txt = text message
tar = target must by text format like jquery
hitar = this is div or any object target must by text format like jquery
p1 = left, right, down - position arrow for box
p2 = left, right, center  - position arrow for wall
option = more options
*/
function showHint(txt, tar, hitar, p1, p2, option){
	var p = $(tar);
	var offset1 = p.offset();
	var offset = p.position();
	
	if(typeof option  == 'undefined') option = {};
	if(option == null) option = {};
	
	if(typeof option.marginLeft == 'undefined') marginL = 0; else marginL = option.marginLeft;
	if(typeof option.marginTop  == 'undefined') marginT = 0; else marginT = option.marginTop;
	if(typeof option.width  == 'undefined') hint_width = 0; else hint_width = option.width;
	if(typeof option.zIndex  == 'undefined') hint_zIndex = 0; else hint_zIndex = option.zIndex;
	if(typeof option.autowrap  == 'undefined') autowrap = true; else autowrap = option.autowrap;
	if(typeof option.position  == 'undefined') position = ''; else position = option.position;
	if(typeof option.autohiden  == 'undefined') autohiden = 0; else autohiden = option.autohiden;

	var hitaro = $(hitar);
	clearTimeout(hinttimeout);
	clearTimeout(hintatimeout);
	
	if(autohiden > 0){
		hintatimeout = setTimeout(function(){closeHint(10);},autohiden);
	}
	
	if(marginT == 'up'){
		position = 'up';
		marginT = 0;
	}
	if(position == 'up'){
		marginT += -1*hitaro.height();
	}
	
	var ptop = marginT+offset1.top;
	var pleft = marginL+offset1.left;
	
	var pos = apic.strpos(txt,' ',0);
	if(hint_width > 0 && autowrap && pos == false){
		var l = txt.length;
		var txt2='';
		
		for(var x=0; x<l; x++){
			txt2 += txt.charAt(x);
			if(x%14==0 && x>0){
				txt2 += " ";
			}
		}
		txt = txt2;
	}
	
	if(hint_zIndex > 0)
		hitaro.css('zIndex',hint_zIndex);
		
	hitaro.css('opacity',1).css('display','').css('top',ptop-4+'px').find('div.txt').html(txt);
	if(hint_width > 0){
		hitaro.css('width',hint_width+'px');
	}else{
		hitaro.css('width','auto');
	}
	
	var c = hitaro.find("div.c");
		
	switch(p1){
		case "left":
			{
				c.css('border-color', 'transparent #000000').css('border-style','solid').css('border-width', '9px 0 9px 9px').css('top','0px').
				css('right','0').css('margin','0px').css('left','auto').css('top','0').css('bottom','auto');
				hitaro.css('left',pleft-hitaro.outerWidth()+'px').css('padding-right','9px');
			}
			break;
		case "right":
			{
				c.css('border-color', 'transparent #000000').css('border-style','solid').css('border-width', '9px 9px 9px 0').css('top','0px').
					css('left','0').css('margin','0px').css('right','auto').css('top','0').css('bottom','auto');
				hitaro.css('left',pleft+p.outerWidth()+9+'px').css('padding-left','9px');
			}
			break;
		case "down":
		{
			hitaro.css('padding','0px 0px 8px 0px');
			c.css('border-color', '#000000 transparent').css('border-style','solid').css('border-width', '8px 8px 0px').css('top','auto').css('bottom','0px');
			switch(p2){
				case 'left':
					c.css('left','0px').css('right','auto').css('margin-left','0');
					hitaro.css('left',pleft+'px');
					break;
				case 'right':
					c.css('right','0px').css('left','auto').css('margin-left','0');
					hitaro.css('left',pleft-(hitaro.width()-16)+'px');
					break;
				case 'center':
					c.css('left','50%').css('right','auto').css('margin-left','-8px');
					hitaro.css('left',pleft-(hitaro.width()-16)/2+'px');
					break;
			}
		}
		break;
	}
}

function closeHint(sleep){
	clearTimeout(hintatimeout);
	if(typeof sleep == 'undefined') sleep = 0;
	if(sleep > 0){
		closeHintSleep($('.hint_bl'), sleep, 100);
	}else{
		$('.hint_bl').css('display','none');
	}
}

function closeHintSleep(ob, sleep, o){
	ob.css('opacity',o/100);
	if(o > 0){
	  sleep--;
		hinttimeout = setTimeout(function(){closeHintSleep(ob, sleep, o-10);},50);
	}else{
		ob.css('display','none');
	}
}
/*HINT*/

/*
 * dodawnia fun clone dla objectow
 * w jquery przy css powoduje bledy prawdopodobnie problemem jest recurencja
*/
/*Object.prototype.clone = function() {
      var newObj = (this instanceof Array) ? [] : {};
      for (i in this) {
        if (i == 'clone') continue;
        if (this[i] && typeof this[i] == "object") {
          newObj[i] = this[i].clone();
        } else newObj[i] = this[i]
      } return newObj;
    };*/
    
var css;
function include_css(css_file) {
    var html_doc = document.getElementsByTagName('head')[0];
    css = document.createElement('link');
    css.setAttribute('rel', 'stylesheet');
    css.setAttribute('type', 'text/css');
    css.setAttribute('href', css_file);
    html_doc.appendChild(css);

    // alert state change
    css.onreadystatechange = function () {
        if (css.readyState == 'complete') {
            alert('CSS onreadystatechange fired');
        }
    }
    css.onload = function () {
        alert('CSS onload fired');
    }
    return false;
}

var js;
function include_js(file) {
    var html_doc = document.getElementsByTagName('head')[0];
    js = document.createElement('script');
    js.setAttribute('type', 'text/javascript');
    js.setAttribute('src', file);
    html_doc.appendChild(js);

    js.onreadystatechange = function (t) {
        //IE6
        //loading, interactive, loaded
        switch(js.readyState){
          case 'complete':
          case 'loaded':
              alert('JS onreadystate fired');
            break;
        }
    }

    js.onload = function () {
        alert('JS onload fired');
    }
    return false;
}

/*
Source: http://www.phpied.com/javascript-include-ready-onload/
Results

As you can probably guess, the results are different in IE and FF.

    * CSS inclusion - IE fires both events, onload first, then onreadystatechange. FF fires nothing.
    * JS inclusion - IE fires onreadystatechange. FF fires onload. Both will execute the script before firing the event.

Conclusion

1. So there is, after all, a cross-browser way to tell when a JavaScript is actually included and that is to attach two event listeners - onload and onreadystatechange.
2. In IE you have two ways to tell when a CSS is included.
*/

var checkCss = ( function ( ) { 
        var div = document. createElement ( 'div' ) , 
        vendors = 'Khtml Ms O Moz Webkit' . split ( ' ' ) , 
        len = vendors. length ; 
  
        return function ( prop ) { 
  
          if ( prop in div. style ){
            return true ; 
          }
          prop = prop. replace ( /^[az]/ , function ( val ) {
            return val. toUpperCase ( ) ; 
          }) ; 
  
          while ( len -- ) { 
            if ( vendors [ len ] + prop in div. style ) { 
              // browser supports box-shadow.  Do what you need. 
              // Or use a bang (!) to test if the browser doesn't. 
              return true ; 
            }
          } 
          return false ; 
        }; 
      }) () ;

var BrowserDetect = {
  init: function () {
    this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
    this.version = this.searchVersion(navigator.userAgent)
      || this.searchVersion(navigator.appVersion)
      || "an unknown version";
    this.OS = this.searchString(this.dataOS) || "an unknown OS";
    this.engine = navigator.product;
    this.engineVer = navigator.productSub;
  },
  searchString: function (data) {
    for (var i=0;i<data.length;i++) {
      var dataString = data[i].string;
      var dataProp = data[i].prop;
      this.versionSearchString = data[i].versionSearch || data[i].identity;
      if (dataString) {
        if (dataString.indexOf(data[i].subString) != -1)
          return data[i].identity;
      }
      else if (dataProp)
        return data[i].identity;
    }
  },
  searchVersion: function (dataString) {
    var index = dataString.indexOf(this.versionSearchString);
    if (index == -1) return;
    return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
  },
  dataBrowser: [
    {
      string: navigator.userAgent,
      subString: "Chrome",
      identity: "Chrome"
    },
    {   string: navigator.userAgent,
      subString: "OmniWeb",
      versionSearch: "OmniWeb/",
      identity: "OmniWeb"
    },
    {
      string: navigator.vendor,
      subString: "Apple",
      identity: "Safari",
      versionSearch: "Version"
    },
    {
      prop: window.opera,
      identity: "Opera"
    },
    {
      string: navigator.vendor,
      subString: "iCab",
      identity: "iCab"
    },
    {
      string: navigator.vendor,
      subString: "KDE",
      identity: "Konqueror"
    },
    {
      string: navigator.userAgent,
      subString: "Firefox",
      identity: "Firefox"
    },
    {
      string: navigator.vendor,
      subString: "Camino",
      identity: "Camino"
    },
    {   // for newer Netscapes (6+)
      string: navigator.userAgent,
      subString: "Netscape",
      identity: "Netscape"
    },
    {
      string: navigator.userAgent,
      subString: "MSIE",
      identity: "Explorer",
      versionSearch: "MSIE"
    },
    {
      string: navigator.userAgent,
      subString: "Gecko",
      identity: "Mozilla",
      versionSearch: "rv"
    },
    {     // for older Netscapes (4-)
      string: navigator.userAgent,
      subString: "Mozilla",
      identity: "Netscape",
      versionSearch: "Mozilla"
    }
  ],
  dataOS : [
    {
      string: navigator.platform,
      subString: "Win",
      identity: "Windows"
    },
    {
      string: navigator.platform,
      subString: "Mac",
      identity: "Mac"
    },
    {
      string: navigator.userAgent,
      subString: "iPhone",
      identity: "iPhone/iPod"
    },
    {
      string: navigator.platform,
      subString: "Linux",
      identity: "Linux"
    }
  ]

};
BrowserDetect.init();
var roimg;
function clk(src, url)
{
	if(document.images)
	{
		var a=encodeURIComponent||escape,b=new Image;
		roimg=b;
		b.onerror=b.onload=b.onabort=function(){
			delete roimg
			if(url && url != "")
			{
				goTo(url);
			}
		};
		var l=window.location+"";
		var i=(new Date).getTime();
		b.src=src;
	}
	return false;

};

function URLEncode (clearString) {
  var output = '';
  var x = 0;
  alert('dd1');
  clearString = clearString.toString();
  var regex = /(^[a-zA-Z0-9_.]*)/;
  alert('dd2');
  while (x < clearString.length) {
    var match = regex.exec(clearString.substr(x));
    if (match != null && match.length > 1 && match[1] != '') {
    	output += match[1];
      x += match[1].length;
    } else {
      if (clearString[x] == ' ')
        output += '+';
      else {
        var charCode = clearString.charCodeAt(x);
        var hexVal = charCode.toString(16);
        output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
      }
      x++;
    }
  }
  return output;
}

/*
   * time_left to juz rezultat roznicy time_left - time();
  */
  function timeleft(time_left) {
    if(time_left > 0) {
      var days = parseInt(time_left / 86400);
      var time_left = time_left - days * 86400;
      var hours = parseInt(time_left / 3600);
      var time_left = time_left - hours * 3600;
      var minutes = parseInt(time_left / 60);
      var seconds = time_left - minutes * 60;
    } else {
      return array(0, 0, 0, 0);
    }
    return new Array(days, hours, minutes, seconds);
  }

  /*function timeleft(time_left) {
    if(endtime != null)
      time_left = endtime - mktime();
    if(time_left > 0) {
      var days = parseInt(time_left / 86400);
      var time_left = time_left - days * 86400;
      var hours = parseInt(time_left / 3600);
      var time_left = time_left - hours * 3600;
      var minutes = parseInt(time_left / 60);
      var seconds = time_left - minutes * 60;
    } else {
      return array(0, 0, 0, 0);
    }
    return new Array(days, hours, minutes, seconds);
  }*/
  
  function mktime() {  
    // Get UNIX timestamp for a date    
    //   
    // version: 901.2514  
    // discuss at: http://phpjs.org/functions/mktime  
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)  
    // +   improved by: baris ozdil  
    // +      input by: gabriel paderni   
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)  
    // +   improved by: FGFEmperor  
    // +      input by: Yannoo  
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)  
    // +      input by: jakes  
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)  
    // +   bugfixed by: Marc Palau  
    // *     example 1: mktime(14, 10, 2, 2, 1, 2008);  
    // *     returns 1: 1201871402  
    // *     example 2: mktime(0, 0, 0, 0, 1, 2008);  
    // *     returns 2: 1196463600  
    // *     example 3: make = mktime();  
    // *     example 3: td = new Date();  
    // *     example 3: real = Math.floor(td.getTime()/1000);  
    // *     example 3: diff = (real - make);  
    // *     results 3: diff < 5  
    // *     example 4: mktime(0, 0, 0, 13, 1, 1997)  
    // *     returns 4: 883609200  
    // *     example 5: mktime(0, 0, 0, 1, 1, 1998)  
    // *     returns 5: 883609200  
    // *     example 6: mktime(0, 0, 0, 1, 1, 98)  
    // *     returns 6: 883609200  
      
    var no, ma = 0, mb = 0, i = 0, d = new Date(), argv = arguments, argc = argv.length;  
  
    if (argc > 0){  
        d.setHours(0,0,0); d.setDate(1); d.setMonth(1); d.setYear(1972);  
    }  
   
    var dateManip = {  
        0: function(tt){ return d.setHours(tt); },  
        1: function(tt){ return d.setMinutes(tt); },  
        2: function(tt){ var set = d.setSeconds(tt); mb = d.getDate() - 1; return set; },  
        3: function(tt){ var set = d.setMonth(parseInt(tt)-1); ma = d.getFullYear() - 1972; return set; },  
        4: function(tt){ return d.setDate(tt+mb); },  
        5: function(tt){ return d.setYear(tt+ma); }  
    };  
      
    for( i = 0; i < argc; i++ ){  
        no = parseInt(argv[i]*1);  
        if (isNaN(no)) {  
            return false;  
        } else {  
            // arg is number, let's manipulate date object  
            if(!dateManip[i](no)){  
                // failed  
                return false;  
            }  
        }  
    }  
  
    return Math.floor(d.getTime()/1000);  
  }
  
function textToPass(ip)
{
    if(ip.type == 'text'){
      ip.val=true;
      var np=ip.cloneNode(true);
      np.type='password';
      if(np.value!=ip.value)
      np.value=ip.value;
      np.val=ip.val;
      /*ip.parentNode.appendChild(np);
      ip.parentNode.removeChild(ip);*/
      ip.parentNode.replaceChild(np,ip);
      np.click();
      return true;
    }
    return false;
}

