﻿
        function starttoggle() {
        $("div #idDiscussionDetails").toggle("slow");
        }
        function starttoggle1() {
        $("div #idDiscussionDetails2").toggle("slow");

        }        
        
        function al() {
                         var val_keyword = document.getElementById('ctl00_ContentPlaceHolder1_txtKeyword').value;
                         var val_Loc = document.getElementById('ctl00_ContentPlaceHolder1_txtLocation').value;
                         if ((val_keyword == 'job title, keywords or company name' || val_keyword == '') && (val_Loc == '' || val_Loc == 'city, state or zip code')) {
                        alert('Please enter at least one value!!');
                        return false;
                    }
        }
        function EnterKeyPress(e) {
            var unicode;
            unicode = e.keyCode;
            if (unicode == 13) {
                var val_keyword = document.getElementById('ctl00_ContentPlaceHolder1_txtKeyword').value;
                var val_Loc = document.getElementById('ctl00_ContentPlaceHolder1_txtLocation').value;
                if ((val_keyword == 'job title, keywords or company name' || val_keyword == '') && (val_Loc == '' || val_Loc == 'city, state or zip code')) {
                    alert('Please enter at least one value!!');
                    return false;
                }
                else if ((unicode >= 33 && unicode <= 35) || (unicode >= 37 && unicode <= 43) || (unicode >= 58 && unicode <= 63) || (unicode >= 123 && unicode <= 126) || (unicode >= 91 && unicode <= 95) || (unicode == 47) || (unicode == 96) || (unicode == 64)) {
                    //Symbols:   ! " # % & ' ( ) * +    key code = unicode >=33 && unicode <=35,unicode >=37 && unicode <=43
                    //Symbols:   ; < = > ?                key code = unicode >=58 && unicode <=63
                    //Symbols:   { | } ~                  key code = unicode >=123 && unicode <=126
                    //Symbols:   [ \ ] ^ _                key code = unicode >=91 && unicode <=95
                    //Symbols:   / ` @                    key code = unicode ==47,96,64               
                    return false;
                }
                else {
                    CreateSearchURLAndRedirect()
                    return false;
                }

            }
        }



        var defaultText = "job title, keywords or company name";

        function WaterMarkForTitle(txt, evt) {
            if (txt.value.length == 0 && evt.type == "blur") {
                txt.style.color = "#2e89ee";
                txt.value = defaultText;
            }
            if (txt.value == defaultText && evt.type == "focus") {
                txt.style.color = "#2e89ee";
                txt.value = "";
            }
        }


        function WaterMarkForFocus(txt, evt) {

            if (evt.type == "focus") {
                txt.style.color = "#2e89ee";
                txt.value = "";
            }
        }

        var defaultText1 = "city, state or zip code";
        function WaterMarkForLocation(txt, evt) {
            if (txt.value.length == 0 && evt.type == "blur") {
                txt.style.color = "#2e89ee";
                txt.value = defaultText1;
            }
            if (txt.value == defaultText1 && evt.type == "focus") {
                txt.style.color = "#2e89ee";
                txt.value = "";
            }
        }

function storeIpAddress() {
         try {
		var httpp = 0;
                var httt = window.location.href;
                var htttvars = httt.split("://");
                if (htttvars[0] == "https") {
                    httpp = 1;
                }

                var htttVar = window.location.href;
             var xmlhttp;
             if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
                 xmlhttp = new XMLHttpRequest();
             }
             else {// code for IE6, IE5
                 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
             }
             xmlhttp.onreadystatechange = function() {

                 if (xmlhttp.readyState == 4) {
                     if (xmlhttp.status == 200) {
                         //alert('store');
                     }
                 }
             }
			
		 if (httpp == "1") {
                    xmlhttp.open("GET", "https://www.jobjobhealth.com/search/storeIpAddress.ashx?url=" + htttVar, true);
                }
                else
	  	xmlhttp.open("GET", "http://www.jobjobhealth.com/search/storeIpAddress.ashx?url=" + htttVar, true);
             
             xmlhttp.send();

         }
         catch (err) {
             txt = "There was an error on this page.\n\n";
             txt += "Error description: " + err.description + "\n\n";
             txt += "Click OK to continue.\n\n";
             alert(txt);
         }
     } 
       
