var cityWindow = '';

function citypopup(document) 
{
    //var url = "cities.aspx?pb=1";
    var url = "cities.html";
    
    var obj = document.all ? document.all["DropDownListRegion"] : document.getElementById("DropDownListRegion"); 
    
    if (typeof(obj) != 'undefined' && obj.options.length > 0 && obj.value > 0)
    {
        url += "&ss=" + obj.value;
    }
	
	if (!cityWindow.closed && cityWindow.location) 
	{
		cityWindow.location.href = url;
	}
	else 
	{
		cityWindow = window.open(url,'cityWindow','height=350,width=200,resizable=1,scrollbars=1');
		
		if (!cityWindow.opener) 
		{
		    cityWindow.opener = self;
		}
	}
	
	if (window.focus) 
	{
	    cityWindow.focus()
	}
	
	return false;
}

function urlencode (url)
{
    var str = "";
    url = escape(url);

    for (i=0; i < url.length; i++)
    {
        var ch = url.charAt(i);
        
        if (ch == '+')
        {
            str += "%2B";
        }
        else if (ch == "/")
        {
            str += "%2F";
        }
        else
        {
            str += ch;
        }
    }
    
    return str;
}

function OnSearchClick(document, window)
{
    var url = "../job_search_wait.aspx?pb=1&co=164";
    var obj = document.all ? document.all["DropDownListRegion"] : document.getElementById("DropDownListRegion"); 
    
    if (typeof(obj) != 'undefined' && obj.options.length > 0 && obj.value > 0)
    {
        url += "&ss=" + obj.options[obj.selectedIndex].text;
    }
    
    obj = null;
    obj = document.all ? document.all["DropDownListCategory"] : document.getElementById("DropDownListCategory"); 
    
    if (typeof(obj) != 'undefined' && obj.options.length > 0 && obj.value > 0)
    {
        url += "&cat=" + obj.value;
    }

    obj = null;
    obj = document.all ? document.all["TitleSearchTextBox"] : document.getElementById("TitleSearchTextBox"); 
    
    if (typeof(obj) != 'undefined')
    {
        url += "&w=" + urlencode(obj.value);
    }

    obj = null;
    obj = document.all ? document.all["TextBoxCity"] : document.getElementById("TextBoxCity"); 
    
    if (typeof(obj) != 'undefined')
    {
        url += "&c=" + obj.value;
    }

    window.location = url;
}

function ShowStates(type)
{
    if (typeof(type) == 'undefined')
    {
        type = 0;
    }
    
    var ddl;
    
    if (document.all)
    {
        ddl = (type == 0 ? document.all["DropDownListRegion"] : document.all["State"]); 
    }
    else
    {
        ddl = (type == 0 ? document.getElementById("DropDownListRegion") : document.getElementById("State")); 
    }
    
    if (typeof(ddl) == 'undefined' || (typeof(ddl) != 'undefined' && ddl.options.length > 0))
    {
        return;
    }
    
    var option = null;
    var Store = new Array();
    Store[0] =  new Array (
                    (type == 0 ? '- Al United States -' : '-------------------- N/A --------------------') ,   
                    'Alabama',
                    'Alaska',
                    'Arizona',
                    'Arkansas',
                    'California',
                    'Colorado',
                    'Connecticut',
                    'Delaware',
                    'District of Columbia',
                    'Florida',
                    'Georgia',
                    'Hawaii',
                    'Idaho',
                    'Illinois',
                    'Indiana',
                    'Iowa',
                    'Kansas',
                    'Kentucky',
                    'Louisiana',
                    'Maine',
                    'Maryland',
                    'Massachusetts',
                    'Michigan',
                    'Minnesota',
                    'Mississippi',
                    'Missouri',
                    'Montana',
                    'Nebraska',
                    'Nevada',
                    'New Hampshire',
                    'New Jersey',
                    'New Mexico',
                    'New York',
                    'North Carolina',
                    'North Dakota',
                    'Ohio',
                    'Oklahoma',
                    'Oregon',
                    'Pennsylvania',
                    'Rhode Island',
                    'South Carolina',
                    'South Dakota',
                    'Tennessee',
                    'Texas',
                    'Utah',
                    'Vermont',
                    'Virginia',
                    'Washington',
                    'West Virginia',
                    'Wisconsin',
                    'Wyoming'
                        );
                        
    Store[1] = new Array (
                    '0', 
                    '1', 
                    '2', 
                    '3', 
                    '4', 
                    '5', 
                    '7', 
                    '8', 
                    '9', 
                    '10', 
                    '11', 
                    '12', 
                    '13', 
                    '14', 
                    '15', 
                    '16', 
                    '17', 
                    '18', 
                    '19', 
                    '20', 
                    '21', 
                    '22', 
                    '23', 
                    '24', 
                    '25', 
                    '26', 
                    '27', 
                    '28', 
                    '29', 
                    '30', 
                    '31', 
                    '32', 
                    '33', 
                    '34', 
                    '35', 
                    '36', 
                    '37', 
                    '38', 
                    '39', 
                    '40', 
                    '41', 
                    '42', 
                    '43', 
                    '44', 
                    '45', 
                    '46', 
                    '47', 
                    '48', 
                    '49', 
                    '50', 
                    '51', 
                    '52', 
                    '53', 
                    '54', 
                    '55', 
                    '56', 
                    '57', 
                    '58', 
                    '59', 
                    '60', 
                    '61', 
                    '62', 
                    '63', 
                    '64', 
                    '65', 
                    '66', 
                    '67', 
                    '68', 
                    '69', 
                    '70', 
                    '71', 
                    '72', 
                    '73', 
                    '74'    
    );                      
    
    for (i = 0; i < Store[0].length; i++)
    {
        if (type == 0)
        {
            option = new Option(Store[0][i], Store[1][i]);
        }
        else
        {
            option = new Option(Store[0][i], (i == 0 ? "" : Store[0][i]));
        }
        
        ddl.options.add(option);
    }
}

function ShowCategories()
{
    var ddl = document.all ? document.all["DropDownListCategory"] : document.getElementById("DropDownListCategory"); 
    
    if (typeof(ddl) == 'undefined' || (typeof(ddl) != 'undefined' && ddl.options.length > 0))
    {
        return;
    }
    
    var option = null;
    var Store = new Array();
    Store[0] = new Array(
                    '- All Job Categories -',
                    'Accounting / Human Resources',
                    'Administrative / Clerical',
                    'Advertising, marketing',
                    'Aerospace and Defense',
                    'Airlines',
                    'Apparel',
                    'Automotive Retailing, Services',
                    'Banking / Finance / Insurance',
                    'Beverages',
                    'Biotechnology',
                    'Building materials, Glass',
                    'Chemicals',
                    'Commercial Banks',
                    'Computer And Data Services',
                    'Computer Peripherals',
                    'Computer Software',
                    'Computers, Office Equipment',
                    'Diversified Financials',
                    'Diversified Outsourcing Services',
                    'Electronics, Electrical Equip.',
                    'Energy',
                    'Engineering, Construction',
                    'Entertainment',
                    'Food and Drug Stores',
                    'Food Consumer Products',
                    'Food Production',
                    'Food Services',
                    'Forest and Paper Products',
                    'Furniture',
                    'General Merchandisers',
                    'Health Care',
                    'Home Equipment, Furnishings',
                    'Homebuilders',
                    'Hotels, Casinos, Resorts',
                    'Household and Personal Products',
                    'Industrial and Farm Equipment',
                    'Information Systems',
                    'Insurance: Life, Health (mutual)',
                    'Insurance: Life, Health (stock)',
                    'Insurance: P & C (mutual)',
                    'Insurance: P & C (stock)',
                    'Mail, Package, Freight Delivery',
                    'Management',
                    'Medical Products & Equipment industry',
                    'Metalsinsert into industry ',
                    'Mining, Crude-oil production',
                    'Miscellaneous',
                    'Motor vehicles and Parts',
                    'Network and Other Communications Equipment',
                    'Oil and Gas Equipment, Services',
                    'Packaging, Containers',
                    'Petroleum Refining',
                    'Pharmaceuticals',
                    'Pipelines',
                    'Professional',
                    'Publishing, Printing',
                    'Railroads',
                    'Real estate',
                    'Sales & Marketing',
                    'Savings Institutions',
                    'Scientific, Photo, Control Equip.',
                    'Securities',
                    'Semiconductors and Other Electronic Components',
                    'Specialty Retailers',
                    'Telecommunications',
                    'Temporary Help',
                    'Textiles',
                    'Tobacco',
                    'Toys, Sporting Goods',
                    'Transportation',
                    'Transportation Equipment',
                    'Trucking, Truck Leasing',
                    'Utilities: Gas & Electric',
                    'Waste Management',
                    'Wholesalers: Diversified',
                    'Wholesalers: Electronics and Office Equipment',
                    'Wholesalers: Food and Grocery',
                    'Wholesalers: Health Care'    
    );
    
    Store[1] = new Array(
                    '0',
                    '72',
                    '73',
                    '1',
                    '2',
                    '3',
                    '4',
                    '5',
                    '74',
                    '6',
                    '78',
                    '7',
                    '8',
                    '9',
                    '10',
                    '11',
                    '12',
                    '13',
                    '14',
                    '15',
                    '16',
                    '17',
                    '18',
                    '19',
                    '20',
                    '21',
                    '22',
                    '23',
                    '24',
                    '25',
                    '26',
                    '27',
                    '28',
                    '29',
                    '30',
                    '31',
                    '32',
                    '75',
                    '33',
                    '34',
                    '35',
                    '36',
                    '37',
                    '76',
                    '38',
                    '39',
                    '40',
                    '70',
                    '41',
                    '42',
                    '43',
                    '44',
                    '45',
                    '46',
                    '47',
                    '71',
                    '48',
                    '49',
                    '50',
                    '77',
                    '51',
                    '52',
                    '53',
                    '54',
                    '55',
                    '56',
                    '57',
                    '58',
                    '59',
                    '60',
                    '61',
                    '62',
                    '63',
                    '64',
                    '65',
                    '66',
                    '67',
                    '68',
                    '69'   
    );
    
    for (i = 0; i < Store[0].length; i++)
    {
        option = new Option(Store[0][i], Store[1][i]);
        ddl.options.add(option);
    }
}

function ShowCountries()
{
    var ddl = document.all ? document.all["Country"] : document.getElementById("Country"); 
    
    if (typeof(ddl) == 'undefined' || (typeof(ddl) != 'undefined' && ddl.options.length > 0))
    {
        return;
    }
    
    var option = null;
    var Store = new Array();
    Store[0] = new Array(
            '------------- Choose One: -------------',
            'United States',
            'Afghanistan', 
            'Albania', 
            'Algeria', 
            'American Samoa', 
            'Andorra', 
            'Angola', 
            'Anguilla', 
            'Antartica', 
            'Antigua and Barbuda', 
            'Argentina', 
            'Armenia', 
            'Aruba', 
            'Australia', 
            'Austria', 
            'Azerbaidjan', 
            'Bahamas', 
            'Bahrain', 
            'Bangladesh', 
            'Barbados', 
            'Belarus', 
            'Belgium', 
            'Belize', 
            'Benin', 
            'Bermuda', 
            'Bhutan', 
            'Bolivia', 
            'Bosnia-Herzegovina', 
            'Botswana', 
            'Bouvet Island', 
            'Brazil', 
            'British Indian Ocean Territory', 
            'Brunei Darussalam', 
            'Bulgaria', 
            'Burkina Faso', 
            'Burundi', 
            'Cambodia', 
            'Cameroon', 
            'Canada', 
            'Cape Verde', 
            'Cayman Islands', 
            'Central African Republic', 
            'Chad', 
            'Chile', 
            'China', 
            'Christmas Island', 
            'Cocos (Keeling) Islands', 
            'Colombia', 
            'Comoros', 
            'Congo', 
            'Cook Islands', 
            'Costa Rica', 
            'Croatia', 
            'Cyprus', 
            'Czech Republic', 
            'Denmark', 
            'Djibouti', 
            'Dominica', 
            'Dominican Republic', 
            'East Timor', 
            'Ecuador', 
            'Egypt', 
            'El Salvador', 
            'Equatorial Guinea', 
            'Eritrea', 
            'Estonia', 
            'Ethiopia', 
            'Falkland Islands', 
            'Faroe Islands', 
            'Fiji', 
            'Finland', 
            'Former USSR', 
            'France', 
            'France (European Territory)', 
            'French Guyana', 
            'French Southern Territories', 
            'Gabon', 
            'Gambia', 
            'Georgia', 
            'Germany', 
            'Ghana', 
            'Gibraltar', 
            'Greece', 
            'Greenland', 
            'Grenada', 
            'Guadeloupe (French)', 
            'Guam', 
            'Guatemala', 
            'Guinea', 
            'Guinea Bissau', 
            'Guyana', 
            'Haiti', 
            'Heard and McDonald Islands', 
            'Honduras', 
            'Hong Kong', 
            'Hungary', 
            'Iceland', 
            'India', 
            'Indonesia', 
            'Iraq', 
            'Ireland', 
            'Israel', 
            'Italy', 
            'Ivory Coast', 
            'Jamaica', 
            'Japan', 
            'Jordan', 
            'Kazakhstan', 
            'Kenya', 
            'Kiribati', 
            'Kuwait', 
            'Kyrgyzstan', 
            'Laos', 
            'Latvia', 
            'Lebanon', 
            'Lesotho', 
            'Liberia', 
            'Liechtenstein', 
            'Lithuania', 
            'Luxembourg', 
            'Macau', 
            'Macedonia', 
            'Madagascar', 
            'Malawi', 
            'Malaysia', 
            'Maldives', 
            'Mali', 
            'Malta', 
            'Marshall Islands', 
            'Martinique (French)', 
            'Mauritania', 
            'Mauritius', 
            'Mayotte', 
            'Mexico', 
            'Micronesia', 
            'Moldavia', 
            'Monaco', 
            'Mongolia', 
            'Montserrat', 
            'Morocco', 
            'Mozambique', 
            'Namibia', 
            'Nauru', 
            'Nepal', 
            'Netherlands', 
            'Netherlands Antilles', 
            'Neutral Zone', 
            'New Caledonia (French)', 
            'New Zealand', 
            'Nicaragua', 
            'Niger', 
            'Nigeria', 
            'Niue', 
            'Norfolk Island', 
            'Northern Mariana Islands', 
            'Norway', 
            'Oman', 
            'Pakistan', 
            'Palau', 
            'Panama', 
            'Papua New Guinea', 
            'Paraguay', 
            'Peru', 
            'Philippines', 
            'Pitcairn Island', 
            'Poland', 
            'Polynesia (French)', 
            'Portugal', 
            'Qatar', 
            'Reunion (French)', 
            'Romania', 
            'Russian Federation', 
            'Rwanda', 
            'S.Georgia and S.Sandwich Islands', 
            'Saint Helena', 
            'Saint Kitts and Nevis Anguilla', 
            'Saint Lucia', 
            'Saint Pierre and Miquelon', 
            'Saint Tome and Principe', 
            'Saint Vincent and Grenadines', 
            'Samoa', 
            'San Marino', 
            'Saudi Arabia', 
            'Senegal', 
            'Seychelles', 
            'Sierra Leone', 
            'Singapore', 
            'Slovakia', 
            'Slovenia', 
            'Solomon Islands', 
            'Somalia', 
            'South Africa', 
            'South Korea', 
            'Spain', 
            'Sri Lanka', 
            'Suriname', 
            'Svalbard and Jan Mayen Islands', 
            'Swaziland', 
            'Sweden', 
            'Switzerland', 
            'Tadjikistan', 
            'Taiwan', 
            'Tanzania', 
            'Thailand', 
            'Togo', 
            'Tokelau', 
            'Tonga', 
            'Trinidad and Tobago', 
            'Tunisia', 
            'Turkey', 
            'Turkmenistan', 
            'Turks and Caicos Islands', 
            'Tuvalu', 
            'Uganda', 
            'Ukraine', 
            'United Arab Emirates', 
            'United Kingdom', 
            'United States', 
            'Uruguay', 
            'USA Minor Outlying Islands', 
            'Uzbekistan', 
            'Vanuatu', 
            'Vatican City', 
            'Venezuela', 
            'Vietnam', 
            'Virgin Islands (British)', 
            'Virgin Islands (USA)', 
            'Wallis and Futuna Islands', 
            'Western Sahara', 
            'Yemen', 
            'Yugoslavia', 
            'Zaire', 
            'Zambia', 
            'Zimbabwe'
    );
    
    for (i = 0; i < Store[0].length; i++)
    {
        option = new Option(Store[0][i], (i == 0 ? "" : Store[0][i]));
        ddl.options.add(option);
    }
            
}

function ShowProducts()
{
    var ddl = document.all ? document.all["ProductInterest"] : document.getElementById("ProductInterest"); 
    
    if (typeof(ddl) == 'undefined' || (typeof(ddl) != 'undefined' && ddl.options.length > 0))
    {
        return;
    }
    
    var option = null;
    var Store = new Array();
    Store[0] = new Array(
            '------------- Choose One: -------------',
            'Push Posting 2.0',
            'Job Boomerang',
            'Job Board',
            'Sharkstrike',
            'Resume Search'
    );

    for (i = 0; i < Store[0].length; i++)
    {
        option = new Option(Store[0][i], (i == 0 ? "" : Store[0][i]));
        ddl.options.add(option);
    }
            
}

function ShowProductSubmissionForm()
{
	ShowStates(1);
	ShowCountries();
	ShowProducts();
}

/* BEGIN: Submitton form functions: solutions, contact us */
	function OnLoad(document)
	{
	    var obj = Request.QueryString('submitted'); 
	    
	    if (typeof(obj) != 'undefined')
	    {
            if (obj == '1')
            {
                SetInfo(document, 'Thank you for submittion');
            }
            else
            {
                SetInfo(document, null);
            }
	    }
	}
	
	function SetInfo(document, message)
	{
        var label = document.all ? document.all['LabelInfo'] : document.getElementById('LabelInfo');
        
        if (typeof(label) != 'undefined')
        {
            if (message == null || message == '')
            {
                label.style.display = 'none';
            }
            else
            {
                label.style.display = 'inline';
                label.value = message;
            }
        }
        
        return false;
	}
	
	function CheckValuesProductInterest(document)
	{

	    SetInfo(document, null); 
	    
	    if(document.all["first_name"].value=="")
	    {
		    alert("Please Fill the first name");
		    document.all["first_name"].focus();
		    return false;
	    }
	    if(document.all["last_name"].value=="")
	    {
		    alert("Please Fill the Last name");
		    document.all["last_name"].focus();
		    return false;
	    }
	    
		if(document.all["email_address"].value=="")
		{
			alert("Please Fill the Email Address.");
			document.all["email_address"].focus();
			return false;
		}
        else
        {
		    var rx = new RegExp("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
		    var matches = rx.exec(document.all["email_address"].value);
    		
		    if ( matches == null || document.all["email_address"].value != matches[0] )
		    {
			    alert("Please input valid email address");
			    document.all["email_address"].focus();
			    return false;	
		    }
		}
		
		if(document.all["phone_number"].value=="")
		{
			alert("Please Fill the phone No.");
			document.all["phone_number"].focus();
			return false;
		}
		else
		{
			var rx2 = new RegExp("(\\d+)*");
			var matches2 = rx2.exec(document.all["phone_number"].value);
			if ( matches2 == null || document.all["phone_number"].value != matches2[0] )
			{
				alert("Please input valid phone No.");
				document.all["phone_number"].focus();
				return false;	
			}
		}
		
	    if(document.all["Country"].value=="")
	    {
		    alert("Please Fill the Country");
		    document.all["Country"].focus();
		    return false;
	    }

	    if(document.all["Country"].value=='United States' && document.all["State"].value=="")
	    {
		    alert("Please Fill the State");
		    document.all["State"].focus();
		    return false;
	    }
	    
	    if(document.all["company2"].value=="")
	    {
		    alert("Please Fill the Company Name");
		    document.all["company2"].focus();
		    return false;
	    }

	    if(document.all["ProductInterest"].value=="")
	    {
		    alert("Please Fill the Product Interest");
		    document.all["ProductInterest"].focus();
		    return false;
	    }

        return true;
	}
	
/* END: Submitton form functions: solutions, contact us */

