$(function(){
	var row=getParameter("row");
	var checkArr=[
		"#company"+row,
		"#manager"+row,
		"#phone"+row,
		"#email"+row
	]
	checkArr.forEach((check)=>{
		if(check.includes("#company"))var input=check.substr(0,check.indexOf('y')+1);
		if(check.includes("#manager"))var input=check.substr(0,check.indexOf('r')+1);
		if(check.includes("#phone"))var input=check.substr(0,check.indexOf('e')+1);
		if(check.includes("#email"))var input=check.substr(0,check.indexOf('l')+1);
		$(check,opener.document).is(":checked")?$(input).prop('checked',true):$(input).prop('checked',false);
	})
	
	
	
	
	function getParameter(name) {
	    name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
	    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
	        results = regex.exec(location.search);
	    return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
	}
	
	
	
})