function CheckUrl(){
	var URL=location.href;
	/*if(URL.substr(0,10)!="http://www"){		window.location.href="http://www.gogimon.com/";
	}*/
}
function makeDefhp(element, url)
{
    element.style.behavior='url(#default#homepage)'; 
    element.setHomePage(url);
}function openwin(strs,Id,w,h,scroll){var mynewwind=window.open(strs+"?Id="+Id,'mynewwind','width='+w+',height='+h+',top=200,left=300,resizable=no scrollbars='+ scroll +' toolbar=no channelmode=no fullscreen=no');return false;}
function makefrvt(self,title)
{
    var chr = 'CTRL-D';
    var agt=navigator.userAgent.toLowerCase();
    if (window.navigator.appName.charAt(0) == "M") window.external.AddFavorite(self,title);
    else alert('Press '+chr+' to bookmark this page.');
    return false;
}
function GonextPage(url){
window.location.href=url;
}
function IfNotSelected(items,radio,msg) {
var bReturn = false;
for (var i = 0;i < items; i++)
{
if (document.getElementById(radio+"_"+i).checked == true)
{bReturn = true;}
}
if (!bReturn){alert(msg);}
return bReturn;
}
function IfNotSelectedProd(msg) {
var bReturn = false;
for (var i = 0;i < document.getElementById("counter").value; i++)
{
if (document.getElementById('check'+i).checked == true)
    {bReturn = true;}
}
if (!bReturn){alert(msg);}
return bReturn;
}
function CheckSearchBox(srch,msg){
    if(document.getElementById(srch).value.trim()==""){
    alert(msg);document.getElementById(srch).focus();return false;}
}    
function CheckClick(e)
{
    var key;

     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

    if (key == 13)
        return false;
    else
        return true;
}
startday = new Date();
clockStart = startday.getTime();
function initStopwatch() 
{ 
		var myTime = new Date(); 
        var timeNow = myTime.getTime();  
        var timeDiff = timeNow - clockStart; 
        this.diffSecs = timeDiff/2000;
        return(this.diffSecs); 
}    
function getSecs() 
{ 
        var mySecs = initStopwatch(); 
        var mySecs1 = ""+mySecs; 
        mySecs1= mySecs1.substring(0,mySecs1.indexOf("."));
        myMinutes=0.1

        mySecs1=myMinutes - mySecs1
        window.setTimeout('getSecs()',4000);
				
        if (mySecs1<=0) 
        {window.close();}
}    
function TextScroll(scrollname, div_name, up_name, down_name)
{
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = 0;
    this.speed = 5;
    this.timeoutID = 0;
    this.div_obj = null;
    this.up_name = up_name;
    this.dn_name = down_name;

{
        if (document.getElementById) {
            div_obj = document.getElementById(this.div_name);
            if (div_obj) {
                this.div_obj = div_obj;
                this.div_obj.style.overflow = 'hidden';
            }
            div_up_obj = document.getElementById(this.up_name);
            div_dn_obj = document.getElementById(this.dn_name);
            if (div_up_obj && div_dn_obj) {
               div_up_obj.onmouseover = function() { eval(scrollname + ".scrollUp();") };
				div_up_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };

				div_dn_obj.onmouseover = function() { eval(scrollname + ".scrollDown();") };
				div_dn_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };
				//window.onload = function() { eval(scrollname + ".ScrollUpLitle();") };
            }
        }
    }

this.stopScroll = function() {
        clearTimeout(this.timeoutID);
    }

this.scrollUp = function() {
        if (this.div_obj) {
            this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
        }
    }
    
this.scrollDown = function() {
		if (this.div_obj) {
			this.scrollCursor += this.speed;
			this.div_obj.scrollTop = this.scrollCursor;
			if (this.div_obj.scrollTop == this.scrollCursor) {
				this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
			} else {
			this.scrollCursor = this.div_obj.scrollTop;
			}
		}
	}

this.resetScroll = function() {
        if (this.div_obj) {
            this.div_obj.scrollTop = 0;
            this.scrollCursor = 0;
        }
    }

this.ScrollUpLitle = function() {
        if (this.div_obj) {
			this.scrollCursor += this.speed;
			this.div_obj.scrollTop = 500;
			if (this.div_obj.scrollTop == this.scrollCursor) {
				this.timeoutID = setTimeout(this.name + ".ScrollUpLitle()", 60);
			}
		}
    }        
    
}
function IfNotfill(items1,items2,items3,msg) {
var bReturn = false;
if (document.getElementById(items1).value != "" && document.getElementById(items2).value != "" && document.getElementById(items3).value != "")
    {bReturn = true;}
if (!bReturn){alert(msg);}
return bReturn;
}
function UrlTo(urls,txt,scp)
{
    var q=Ecoding(document.getElementById(txt).value);
    if(scp!="")
         document.location.href=urls + q + "&scope=" + scp;
    else
         document.location.href=urls + q;    
}
function urls(urls,txt,scp)
{
    var input="";
    input=document.getElementById(txt).value.replace(/'/ig, "\"");
     if(scp!="")
        return window.status=urls + Ecoding(input) + "&scope=" + scp;
     else
        return window.status=urls + Ecoding(input);
}
function Submits(Urls,obj1,obj2,scp)
{
    var input="";
    input=document.getElementById(obj2).value.replace(/'/ig, "\"");
    if(!CheckClick(event)){
    document.getElementById(obj1).action=Urls + Ecoding(input)+ "&scope=" + scp;
    document.getElementById(obj1).submit();}
}
function Ecoding(str)
{
  //var inputString=document.forms["TestEncodingForm"]["encodedInputString"].value;  
  var encodedInputString=escape(str);
  encodedInputString=encodedInputString.replace("+", "%2B");
  encodedInputString=encodedInputString.replace("/", "%2F"); 
  //document.forms["TestEncodingForm"]["inputString"].value=encodedInputString;
  return encodedInputString;
}
function blank(obj)
{
    document.getElementById(obj).value="";
}
function Check(obj)
{
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if (document.getElementById(obj).value == "" || document.getElementById(obj).value=="Email Address"){
        alert("Please fill your E-mail address");
        document.getElementById(obj).focus();blank(obj);
        return false;
    }
    else
   if (!filter.test(document.getElementById(obj).value)) {
    alert("Please provide a valid email address");
    document.getElementById(obj).focus();
    return false;
    }
    else
        return true;
}
