
/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["mainIFrame", "datamain"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller



function GetDay(intDay){
    var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", 
                         "Thursday", "Friday", "Saturday")
    return DayArray[intDay]
}

function GetMonth(intMonth){
    var MonthArray = new Array("January", "February", "March",
                               "April", "May", "June",
                               "July", "August", "September",
                               "October", "November", "December") 
    return MonthArray[intMonth] 	  	 
}

function getDateStrWithDOW(){
    var today = new Date()
    var year = today.getYear()
    if(year<1000) year+=1900
    var todayStr = GetDay(today.getDay()) + ", "
    todayStr += GetMonth(today.getMonth()) + " " + today.getDate()
    todayStr += ", " + year
    return todayStr
}

function itc()
{
AppWnd=window.open("http://d.indiafm.com/pru.htm","win1","toolbar=no,directories=no, resize=no,menubar=no,location=no,scrollbars=no,width=400,height=400,maximize=no"); 
}

function popwindow(url,width,height)
{
	var temp = "menubar=yes,toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width="+width+",height="+height; 
	displayWindow=window.open(url,"displayWindow",temp) ;

}



//Library functions - Begin
// Shortcut to the getElementById function.
function $(x) 
{
    if (typeof x == "string") {
        return document.getElementById(x);
    } else {
        return x;
    }
}
String.prototype.trim = function() {
   return this.replace(/\s+$/, '');
};
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}
//Library functions - End

//Empty String validation method
function valEmpty( txtValue, msg )
{
	if( trim(txtValue)=="")
	{
		alert( msg );
		return false;
	}
	return true;
}

//State code validation method
function valState( txtState, msg )
{
	if( txtState.length != 2 )
	{
		alert( msg );
		return false;
	}
	if (/[^A-Z]/.test(txtState.toUpperCase()))
 	{
		alert( msg );
		return false;
 	}

	return true;
}

//ZIP code validation method
function valZip( txtZip )
{
	if( txtZip == "")
	{
		alert("Please enter the zip!");
		return false;
	}
	if( txtZip.length < 5)
	{
		alert("Zip code is not valid!");
		return false;
	}
	else
	{
		if( txtZip.length > 5 )
		{
			if( txtZip.length != 10)
			{
				alert("Zip code is not valid!");
				return false;
			}
			if( txtZip.substr(5,1) != "-")
			{
				alert("Zip code is not valid!");
				return false;
			}
			if( isNaN(txtZip.substr(0,5)))
			{
				alert("Zip code must be numeric!");
				return false;
			}
			if( isNaN(txtZip.substr(6,4)))
			{
				alert("Zip code must be numeric!");
				return false;
			}
		}
		else
		{
			if( isNaN(txtZip))
			{
				alert("Zip code must be numeric!");
				return false;
			}
		}
	}
	return true;
}

//Phone number validation method
function valPhone( txtPhone )
{
	if( txtPhone.length != 10)
	{
		alert("Please enter the 10 digit phone number with area code!");
		return false;
	}
	if( isNaN(txtPhone))
	{
		alert("Phone number must be numeric!");
		return false;
	}
	return true;
}

//eMail id validation method
function valEmail(txtEmail)
{
 	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(txtEmail)))
	{
		alert("eMail address is not valid!");
		return false;
	}
	return true;
}

function ValidateNumeric() 
{ 
    var keyCode = window.event.keyCode; 
    if (keyCode > 57 || keyCode < 48) 
      window.event.returnValue = false; 
} 







function funcAlert() 
{ 
alert("Page is under construction!!! Please email to 'hr@dscco.net'"); 
} 
function funcReferAFriend() 
{ 
    var ifMain = document.getElementById("mainIFrame");
    ifMain.height="1144"; 
    ifMain.src="ReferAFriend.aspx"; 
} 
function funcHomePage()
{ 
    var ifMain = document.getElementById("mainIFrame"); 
    ifMain.height="500"; 
    ifMain.src="HomePage.aspx";
} 
function funcSupportPage() 
{ 
    var ifMain = document.getElementById("mainIFrame");
    ifMain.height="500"; 
    ifMain.src="SupportPage.aspx"; 
} 
function funcContactUsPage() 
{ 
    var ifMain = document.getElementById("mainIFrame");
    ifMain.height="500"; 
    ifMain.src="ContactUs.aspx"; 
} 
function funcServicesPage() 
{ 
    var ifMain = document.getElementById("mainIFrame");
    ifMain.height="500"; 
    ifMain.src="ServicesPage.aspx"; 
} 


